package org.stragma.symbian.units;

import org.stragma.symbian.*;

/**
 * This class is responsible for creating and
 * returning an instance of a unit which is testable
 * in the current scope of the application
 */
public final class UnitFactory<T> {

	/**
	 * Factory method
	 */
	public ITestable createUnit(Class<T> unitType) {
		ITestable returnVal = null;
		try {
			returnVal = (ITestable) unitType.newInstance();
		} catch (IllegalAccessException ex) {
			// Do nothing at this point, might need to fix this later
		} catch (InstantiationException ex) {
		}
		
		return returnVal;
	}
}